<template>
  <div id="app">
  <router-view></router-view>
         </div>
</template>

<script>
export default {
  name: 'App',
  mounted(){
    /*监听窗口加载事件  刷新*/
     window.addEventListener("unload",this.saveState)
  },
  methods:{
    saveState(){                       /*z转为json*/
      sessionStorage.setItem("state",JSON.stringify(this.$store.state));
    }
  }
  }
</script>

<style>
</style>
